package lao_idgen

import (
	config "gitee.com/laoniu11/lao-config"
	"github.com/yitter/idgenerator-go/idgen"
	"math/rand"
	"strconv"
)

func init() {
	wid := config.GetInt("appid", rand.Intn(64))
	ops := idgen.NewIdGeneratorOptions(uint16(wid))
	idgen.SetIdGenerator(ops)
}

func NextId() uint64 {
	return idgen.NextId()
}

func NextIdStr() string {
	theId := idgen.NextId()
	return strconv.FormatInt(int64(theId), 10)
}


